package org.example.StudentManagementSystem;

import org.example.constant.EnrollmentStatus;

import java.time.LocalDate;

public class  JuniorStudent extends Student implements eveningSelfStudy {
    private Integer history;
    private Integer physics;

    public JuniorStudent(int studentId, String studentName, Integer chinese, Integer math, LocalDate enrollmentDate, String mail, String avatar, EnrollmentStatus enrollmentStatus, Integer history, Integer physics) {
        super(studentId, studentName, chinese, math, enrollmentDate, mail, avatar, enrollmentStatus);
        this.history = history;
        this.physics = physics;
    }

    public JuniorStudent(int studentId, String studentName, Integer chinese, Integer math, LocalDate enrollmentDate, Integer history, Integer physics) {
        super(studentId, studentName, chinese, math, enrollmentDate);
        this.history = history;
        this.physics = physics;
    }

    public JuniorStudent(int studentId, String studentName, Integer chinese, Integer math, LocalDate enrollmentDate, String mail, Integer history, Integer physics) {
        super(studentId, studentName, chinese, math, enrollmentDate, mail);
        this.history = history;
        this.physics = physics;
    }

    public JuniorStudent() {
    }

    public JuniorStudent(Integer history, Integer physics) {
        this.history = history;
        this.physics = physics;
    }

    public JuniorStudent(int studentId, String studentName, Integer chinese, Integer math, Integer history, Integer physics) {
        super(studentId, studentName, chinese, math);
        this.history = history;
        this.physics = physics;
    }

    public JuniorStudent(int id, String name, Integer chinese, Integer math) {
        super(id, name, chinese, math);
    }

    public JuniorStudent(Integer studentId, String studentName, Integer chinese, Integer math, LocalDate enrollmentDate, String mail, EnrollmentStatus enrollmentStatus, Integer history, Integer physics) {
    }

    public Integer getHistory() {
        return history;
    }

    public void setHistory(Integer history) {
        this.history = history;
    }

    public Integer getPhysics() {
        return physics;
    }

    public void setPhysics(Integer physics) {
        this.physics = physics;
    }

    @Override
    public void eveningStudy() {
        System.out.println("中学生" + getStudentName() + "正在上晚自习");
    }

    //求初中生的总成绩
    @Override
    public int getTotalScore() {
        return super.getTotalScore() + (history == null ? 0 : history) + (physics == null ? 0 : physics);
    }

    //显示初中生信息（字符串拼接）
    public String toString() {
        return super.getStudentId() + " " + super.getStudentName() + " " + super.getChinese() + " " + super.getMath() + " " + history + " " + physics + " "
                + super.getMail() + " " + super.getEnrollmentDate() + " " + getTotalScore() + " " + super.getAvatar() + " " + super.getEnrollmentStatus();
    }
}
